const path = require("path");
const { merge } = require("webpack-merge");
const common = require("./webpack.common.config");
const webpack = require("webpack");
// 应用合并公共webpack配置
module.exports = merge(common, {
  mode: "production",
  output: {
    filename: "[name].[chunkhash:8].js",
    path: path.resolve(__dirname, "dist"),
    // 资源文件
    assetModuleFilename: "images/[hash][ext][query]",
    clean: true,
    publicPath: "./"
  },
  plugins: [
    new webpack.EnvironmentPlugin({
      NODE_ENV: "production", // 使用 'development' ，除非 process.env.NODE_ENV 被定义
      DEBUG: false
    })
  ]
});
